package com.company.loganalyzer.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;

import java.time.Duration;

/**
 * ElasticSearch配置类
 * 
 * 配置ES客户端连接和Repository扫描
 * 对应Python版本的es_client.py功能
 * 
 * 注意：ES 7.17版本使用Spring Boot自动配置
 */
@Configuration
@EnableElasticsearchRepositories(basePackages = "com.company.loganalyzer.repository")
@ConfigurationProperties(prefix = "elasticsearch")
@Data
public class ElasticsearchConfig {

    private String hosts = "localhost:9200";
    private String username;
    private String password;
    private String scheme = "http";
    private String indexPattern = "cloud_api-";
    private int pageSize = 100;
    private Duration connectionTimeout = Duration.ofSeconds(10);
    private Duration socketTimeout = Duration.ofSeconds(30);
}